Skip to content

Conversation

MihaZupan
Copy link
Member

@MihaZupan MihaZupan commented Oct 10, 2025

Removes a bunch of duplicated fallbacks that were forced to pin the buffers
#94941

@MihaZupan MihaZupan added this to the 11.0.0 milestone Oct 10, 2025
@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 20:25
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 10, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes duplicated encoding fallback code that was forced to pin buffers for older target frameworks by introducing polyfills and utilizing the IncludeSpanPolyfills property. The changes consolidate encoding operations to use modern span-based APIs consistently across all target frameworks.

Key changes:

  • Removes custom span-to-pointer bridging code in favor of centralized polyfills
  • Replaces custom Utf8GetString helper methods with direct Encoding.UTF8.GetString calls
  • Adds IncludeSpanPolyfills=true to project files that need encoding polyfills

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
JsonWriterHelper.cs Simplified UTF-8 encoding methods by removing manual buffer pinning
ThrowHelper.cs Replaced custom UTF-8 string conversion with standard encoding method
JsonHelpers.cs Removed custom Utf8GetString helper method and updated callers
EncodingPolyfills.cs Added centralized polyfills for span-based encoding APIs
Directory.Build.targets Added polyfills to the build system
Various .csproj files Enabled span polyfills for affected libraries

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@teo-tsirpanis teo-tsirpanis added area-Meta and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Oct 11, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

@MihaZupan MihaZupan merged commit af3b955 into dotnet:main Oct 15, 2025
83 of 86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants